import request from '/@/utils/request';

export function fetchList(query?: any) {
	return request({
		url: '/schedule/job/page',
		method: 'post',
		data: query,
	});
}

export function addObj(obj?: any) {
	return request({
		url: '/schedule/job/add',
		method: 'post',
		data: obj,
	});
}

export function getObj(id?: string) {
	return request({
		url: '/schedule/job/findById/' + id,
		method: 'get',
	});
}

export function delObj(ids?: any[]) {
	return request({
		url: '/schedule/job/delete',
		method: 'delete',
		data: ids,
	});
}

export function putObj(obj?: Object) {
	return request({
		url: '/schedule/job/update',
		method: 'put',
		data: obj,
	});
}

export function startJobRa(jobIds?: string[]) {
	return request({
		url: '/schedule/job/start',
		method: 'post',
		data: jobIds,
	});
}

export function runJobRa(jobIds?: string[]) {
	return request({
		url: '/schedule/job/run',
		method: 'post',
		data: jobIds,
	});
}

export function shutDownJobRa(jobIds?: string[]) {
	return request({
		url: '/schedule/job/stop',
		method: 'post',
		data: jobIds,
	});
}
